<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/include.inc.jsp" %>
<!DOCTYPE html>
<html>
<head>
    <%@include file="/WEB-INF/views/layout/miiteen/base.ref.jsp" %>
</head>
<body>
<div class="mainpage edit">
    <!--顶部菜单-->
    <div class="page-topmenu">
        <shiro:hasPermission name="sysConfiguration:edit">
            <div class="btn-panel">
                <el-button type="primary" size="small" icon="el-icon-check" @click="save">保存</el-button>
            </div>
        </shiro:hasPermission>
    </div>
    <!--编辑表单-->
    <el-form :ref="formid" :model="form" :rules="rules" size="small" :label-width="labelwidth"
             :label-position="labelposition"
             class="one-col" :validate-on-rule-change="false">
        <!--视业务进行更改-begin-->
        <el-form-item label="公司Logo" prop="logoUrl">
            <el-upload
                    action="${ctx}/fileupload/upload"
                    :show-file-list="false"
                    :on-success="handleSuccess">
                <img style="max-width: 300px;max-height: 300px;" v-if="form.logoUrl" :src="form.logoUrl">
                <i v-else class="el-icon-plus avatar-uploader-icon"></i>
            </el-upload>
        </el-form-item>
        <el-form-item label="公司名称" prop="companyName">
            <el-input v-model="form.companyName" placeholder="公司名称"></el-input>
        </el-form-item>
        <el-form-item label="系统名称" prop="sysName">
            <el-input v-model="form.sysName" placeholder="系统名称"></el-input>
        </el-form-item>
        <el-form-item label="系统版本">
            <el-input v-model="form.sysVersion" placeholder="系统版本"></el-input>
        </el-form-item>
        <el-form-item label="欢迎语句">
            <el-input v-model="form.greeting" placeholder="欢迎语句"></el-input>
        </el-form-item>
        <el-form-item label="联系方式">
            <el-input v-model="form.contact" placeholder="联系方式"></el-input>
        </el-form-item>
        <!--视业务进行更改-end-->
    </el-form>
</div>
<script>
    //初始化数据，必须放置在列表页面封装部分前
    function initVueOption(obj) {
        //设置控制器
        obj.data.controller = "${ctx}/sysConfiguration";
        //设置表单数据
        obj.data.form = ${sysConfiguration};
        //设置校验规则，没有则删掉
        obj.data.rules = {
            jobNo: [
                {required: true, message: '请输入工号', trigger: 'blur'}
            ],
            trueName: [
                {required: true, message: '请输入姓名', trigger: 'blur'}
            ]
        }

        obj.methods.handleSuccess = function (res, file) {
            if (res.state > 0) {
                this.form.logoUrl = res.data;
            } else {
                window.parent.mtMsg.warnbox(res.methods);
            }
        }

    }
</script>
<!--编辑页面封装部分-->
<%@include file="/WEB-INF/views/layout/miiteen/page.edit.ref.jsp" %>
</body>
</html>